﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;

namespace LyyCMS.Core.Models
{
    [Table("Article")]
    public class Article : Entity<int>, IHasCreationTime,IHasDeletionTime, IFullAudited
    {
        /// <summary>
        /// 文章标题
        /// </summary>
        [Required]
        [MinLength(6,ErrorMessage ="标题不能少于6个字符")]
        [DisplayName("文章标题")]
        public string Title { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        [Required]
        [DisplayName("文章分类")]
        public int ArticleCategoryId { get; set; }

        /// <summary>
        /// 文章分类
        /// </summary>
        [DisplayName("文章分类")]
        public virtual ArticleCategory Category { get; set; }

        /// <summary>
        /// 点击量
        /// </summary>
        [DefaultValue(0)]
        [DisplayName("点击量")]
        public int Click { get; set; }

        /// <summary>
        /// 封面图片
        /// </summary>
        [DisplayName("封面图片")]
        public string ImgUrl { get; set; }

        /// <summary>
        /// URL
        /// </summary>
        [Url]
        [DisplayName("Url地址")]
        public string Url { get; set; }

        /// <summary>
        /// 文章内容摘要
        /// </summary>
        [DisplayName("文章摘要")]
        public string Summary { get; set; }

        /// <summary>
        /// 文章内容 
        /// </summary>
        [Column(TypeName ="text")]
        [DisplayName("文章内容")]
        public string Content { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [DefaultValue(99)]
        [DisplayName("排序")]
        public int SortId { get; set; }


        /// <summary>
        /// SEO标题
        /// </summary>
        [DisplayName("SEO标题")]
        public string SEOTitle { get; set; }
        /// <summary>
        /// SEO关键字
        /// </summary>
        [DisplayName("SEO Key")]
        public string SEOKey { get; set; }

        /// <summary>
        /// SEO描述
        /// </summary>
        [DisplayName("SEO描述")]
        public string SEODescription { get; set; }

        [DisplayName("创建时间")]
        public DateTime CreationTime { get; set; }
        [DisplayName("删除时间")]
        public DateTime? DeletionTime { get; set; }

        [DisplayName("已删除?")]
        public bool IsDeleted { get; set; }

        [DisplayName("创建人")]
        public long? CreatorUserId { get; set; }
        [DisplayName("修改人")]
        public long? LastModifierUserId { get; set; }
        [DisplayName("修改时间")]
        public DateTime? LastModificationTime { get; set; }
        [DisplayName("删除人")]
        public long? DeleterUserId { get; set; }
    }
}
